package com.hzdesk.media.matvector.koreabatch.client.my_paperless.logic.modle;

import android.content.Context;

import com.hzdesk.media.matvector.koreabatch.client.my_paperless.bean.LoginInfoBean;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.logic.contract.IPersonalInformationContract;
import com.hzdesk.media.matvector.koreabatch.client.my_paperless.utils.SharedPreferencesUtils;

/**
 * Created by Administrator on 2018/8/17.
 * 杭州席媒科技有限公司  Developers  刘传华  10
 * 佛祖镇楼 bug辟易
 */

public class PersonalInformationMolde implements IPersonalInformationContract.IPersonalInformationMolde {
    @Override
    public String getToken(Context context) {
        return (String) SharedPreferencesUtils.getInstance(context).getDate("token","String");
    }

    @Override
    public String getId(Context context) {
        return (String) SharedPreferencesUtils.getInstance(context).getDate("id","String");
    }

    @Override
    public String getImageUrl(Context context) {
        return (String) SharedPreferencesUtils.getInstance(context).getDate("imageUrl","String");
    }

    @Override
    public void saveImageUrl(Context context, String imageUrl) {
        SharedPreferencesUtils.getInstance(context).putDate("imageUrl",imageUrl);
    }


    @Override
    public String getNiName(Context context) {
        return (String) SharedPreferencesUtils.getInstance(context).getDate("realName","String");
    }

    @Override
    public void saveNiName(Context context, String NiName) {
        SharedPreferencesUtils.getInstance(context).putDate("realName",NiName);
    }


    @Override
    public int getGender(Context context) {
        return (Integer) SharedPreferencesUtils.getInstance(context).getDate("sex","Integer");
    }

    @Override
    public void saveGender(Context context, int index) {
        SharedPreferencesUtils.getInstance(context).putDate("sex",index);
    }

    @Override
    public void savePersonalInfo(Context context, LoginInfoBean bean) {
        SharedPreferencesUtils mSharedPreferencesUtils = SharedPreferencesUtils.getInstance(context);
        mSharedPreferencesUtils.putDate("createTime",bean.getCreateTime());
        mSharedPreferencesUtils.putDate("creator",bean.getCreator());
        mSharedPreferencesUtils.putDate("updateTime",bean.getUpdateTime());
        mSharedPreferencesUtils.putDate("updator",bean.getUpdator());
        mSharedPreferencesUtils.putDate("delFlag",bean.getDelFlag());
        mSharedPreferencesUtils.putDate("id",bean.getId());
        mSharedPreferencesUtils.putDate("companyId",bean.getCompanyId());
        mSharedPreferencesUtils.putDate("deptId",bean.getDeptId());
        mSharedPreferencesUtils.putDate("type",bean.getType());
        mSharedPreferencesUtils.putDate("realName",bean.getRealName());
        mSharedPreferencesUtils.putDate("userName",bean.getUserName());
        mSharedPreferencesUtils.putDate("password",bean.getPassword());
        mSharedPreferencesUtils.putDate("enterTime",bean.getEnterTime());
        mSharedPreferencesUtils.putDate("leavingTime",bean.getLeavingTime());
        mSharedPreferencesUtils.putDate("tel",bean.getTel());
        mSharedPreferencesUtils.putDate("mobile",bean.getMobile());
        mSharedPreferencesUtils.putDate("email",bean.getEmail());
        mSharedPreferencesUtils.putDate("imageUrl",bean.getImageUrl());
        mSharedPreferencesUtils.putDate("sex",bean.getSex());
        mSharedPreferencesUtils.putDate("address",bean.getAddress());
        mSharedPreferencesUtils.putDate("careerId",bean.getCareerId());
        mSharedPreferencesUtils.putDate("mobileType",bean.getMobileType());
        mSharedPreferencesUtils.putDate("mobileDeviceId",bean.getMobileDeviceId());
        mSharedPreferencesUtils.putDate("companyName",bean.getCareerName());
        mSharedPreferencesUtils.putDate("status",bean.getStatus());
        mSharedPreferencesUtils.putDate("deptName",bean.getDeptName());
        mSharedPreferencesUtils.putDate("imageType",bean.getImageType());
        mSharedPreferencesUtils.putDate("careerName",bean.getCareerName());
        mSharedPreferencesUtils.putDate("queryChildrenDeptPerson",bean.getQueryChildrenDeptPerson());
        mSharedPreferencesUtils.putDate("queryStatus",bean.getQueryStatus());
        mSharedPreferencesUtils.putDate("deptIds",bean.getDeptIds());
        mSharedPreferencesUtils.putDate("messageId",bean.getMessageId());
    }


}
